home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / Dialog Director 0.6 / Examples / Test.as < prev    next >
Encoding:
Text File  |  1997-04-09  |  3.8 KB  |  51 lines  |  [TEXT/ToyS]

  1. property Password : {size:[260, 95], timeout after:10, style:movable modal, contents:[¬
  2.     {class:push button, bounds:[190, 65, 250, 85], name:"OK", enabled:3}, ¬
  3.     {class:push button, bounds:[110, 65, 170, 85], name:"Cancel"}, ¬
  4.     {class:password field, bounds:[10, 36, 250, 36 + 16], name bounds:[10, 10, 250, 26], name:"Enter Password:", value:"1234"}]}
  5.  
  6. set n to 15
  7. set pb1 to {class:push button, bounds:[430, 390, 490, 410], name:"OK", enabled:[dAnd, n + 2]}
  8. set pb2 to {class:push button, bounds:[350, 390, 410, 410], name:"Cancel", help:"push button 2"}
  9. set cb1 to {class:check box, bounds:[350, 320, 480, 336], name:"check option 1", value:true, help:"check option 1 help"}
  10. set cb2 to {class:check box, bounds:[350, 340, 480, 356], name:"enabled A ≠ 3", value:false, enabled:-(Sub(12, 3))}
  11. set rg1 to {class:radio group, bounds:[310, 26, 380, 42], button offset:{100, 20}, max down:4, value:2, contents:¬
  12.     ["radio 1", "radio 2", "radio 3", "radio 4", "radio 5", "radio 6", "radio 7"]}
  13. set ed1 to {class:text field, bounds:[60, 160, 200, 176], name bounds:[10, 160, 60, 180], name:"Text:", value:"default text"}
  14. set ed2 to {class:text field, bounds:[60, 190, 200, 206], name bounds:[10, 190, 60, 210], name:"Text 2:", value:"more text"}
  15. set box1 to {class:group box, name:" Box ", bounds:[300, 16, 490, 112]}
  16. set st1 to {class:static text, contents:"Static Text", bounds:[10, 10, 220, 30], font:{size:18, name:"Times", style:italic, colour:[65535, 0, 0]}}
  17. set pb3 to {class:push button, bounds:[10, 370, 70, 410], name:"Hello" & return & "World!", action:Password, enabled:-10}
  18. set mu1 to {class:pop up, name:"Pop up:", bounds:[10, 65, 220, 84], name width:60, value:2, contents:¬
  19.     "One;Two;Three;Four;Five;Six;Item Number Seven", enabled:[dAnd, 4, Sub(5, 4)]}
  20. set mu2 to {class:pop up, name:"A:", bounds:[10, 40, 130, 59], name width:20, value:10, contents:¬
  21.     "1;2;3;4;(-;6;<BBold;<IItalic;<UUnderline;10"}
  22. set pic1 to {class:pict, bounds:[10, 90, 10 + 198, 90 + 47], contents:131}
  23. set ic1 to {class:icon, bounds:[160, 10, 192, 42], contents:128}
  24. set ic2 to {class:icon, bounds:[210, 10, 242, 42], contents:129}
  25.  
  26. set str to "Enable & Disable edit text."
  27. set cb3 to {class:check box, bounds:[290, 130, 420, 146], name:"Enable Fields", value:true}
  28. set ed3 to {class:text field, bounds:[300, 150, 470, 150 + 64], value:str, enabled:[dAnd, n + 1, n + 3]}
  29. set pw3 to {class:password field, bounds:[300, 222, 470, 238], value:str, enabled:n + 1, name bounds:¬
  30.     [224, 222, 295, 238], name:"Password:"}
  31. set tx3 to {class:static text, bounds:[81, 370, 339, 370 + 36], font:{name:"Geneva", size:9} ¬
  32.     , contents:"This is a sample dialog created by Dialog Director.  It demonstrates many" & ¬
  33.     " advanced features of Dialog Director including dependencies and embeded sub-dialogs."}
  34.  
  35. set ic3 to {class:icon, bounds:[250, 50, 282, 82], contents:2}
  36. set ln1 to {class:group box, bounds:[10, 130, 210, 132]}
  37. set lb1Items to (list folder (path to system folder) without invisibles) & "" & (list folder (path to control panels folder) without invisibles)
  38. set lb1 to {class:list box, bounds:[10, 220, 210, 350], contents:lb1Items, enabled:3}
  39. set mu3 to {class:pop up, name:"Font:", bounds:[300, 250, 480, 270], name width:40, contents:"FONT", enabled:-(Sub(22, 5))}
  40. set dum1 to {class:dummy, enabled:[dAnd, 6, 7, 17, 18]}
  41. set gb1 to {class:group box, bounds:[156, 6, 156 + 40, 6 + 40], style:tertiary group}
  42. set gb2 to {class:group box, bounds:[77, 367, 343, 409], style:secondary group}
  43. set ln2 to {class:group box, bounds:[220, 130, 224, 349]} --, style:tertiary group}
  44.  
  45. set dItems to [pb1, pb2, cb1, cb2, rg1, ed1, ed2, box1, st1, pb3, mu1, mu2, pic1 ¬
  46.     , ic1, ic2, cb3, ed3, pw3, tx3, ic3, ln1, lb1, dum1, mu3, gb1, gb2, ln2]
  47. set dlog to dd auto dialog {default:1, size:[500, 420], contents:dItems, name:"Just Testing!", style:document window} with greyscale
  48.  
  49. on Sub(itemNo, subItem)
  50.     return itemNo + subItem * 256
  51. end Sub